package com.lxq.LeetCode.buildArray;

import java.util.ArrayList;
import java.util.List;

public class Solution {
    public static void main(String[] args) {
        System.out.println(buildArray(new int[]{2,3,5}, 100));
    }

    public static List<String> buildArray(int[] target, int n) {
        List<String> res = new ArrayList<>();
        int flag = 0;
        for (int i = 0; i < target.length; i++) {
            flag++;
            res.add("push");
            while (flag != target[i]) {
                res.add("pop");
                res.add("push");
                flag++;
            }
        }
        return res;
    }
}
